package com.frejoys.common.dto.app;

import com.frejoys.common.error.HttpStatus;
import com.frejoys.common.exception.GeneralException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class CodeDto {

//    @NotNull(message = "{600}")
    @Schema(type = "Long", name = "code", description = "支付码", required = true, defaultValue = "1")
    private Long code;

    @Schema(type = "Integer", name = "id", description = "id", required = true, defaultValue = "1")
    private Integer id;

    @Schema(type = "double", name = "lng", description = "经度", required = true, defaultValue = "1")
    private double lng;

    @Schema(type = "double", name = "lat", description = "纬度", required = true, defaultValue = "1")
    private double lat;

    public Integer getId() {
        if (this.id == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return id;
    }
}
